package cn.wolfcode.car.business.service.impl;

import cn.wolfcode.car.business.domain.StockBillItem;
import cn.wolfcode.car.business.domain.Statement;
import cn.wolfcode.car.business.mapper.StockBillItemMapper;
import cn.wolfcode.car.business.mapper.StatementMapper;
import cn.wolfcode.car.business.query.StockBillItemQuery;
import cn.wolfcode.car.business.service.IStockBillItemService;
import cn.wolfcode.car.common.base.page.TablePageInfo;
import cn.wolfcode.car.common.exception.BusinessException;
import cn.wolfcode.car.common.util.Convert;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
@Transactional
public class StockBillItemServiceImpl implements IStockBillItemService {

    @Autowired
    private StockBillItemMapper stockBillItemMapper;


    @Override
    public TablePageInfo<StockBillItem> query(StockBillItemQuery qo) {
        PageHelper.startPage(qo.getPageNum(), qo.getPageSize());
        return new TablePageInfo<StockBillItem>(stockBillItemMapper.selectForList(qo));
    }


    @Override
    public void save(StockBillItem stockBillItem) {
        stockBillItemMapper.insert(stockBillItem);
    }

    @Override
    public StockBillItem get(Long id) {
        return stockBillItemMapper.selectByPrimaryKey(id);
    }

    @Override
    public void update(StockBillItem stockBillItem) {

        stockBillItemMapper.updateByPrimaryKey(stockBillItem);
    }



}
